[INFO] cloning repository https://github.com/ActivityWatch/aw-watcher-window-wayland
[INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/ActivityWatch/aw-watcher-window-wayland" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FActivityWatch%2Faw-watcher-window-wayland", kill_on_drop: false }`
[INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FActivityWatch%2Faw-watcher-window-wayland'...
[INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }`
[INFO] [stdout] c14e6fbaf1b811a46ec6b5c27d8656f0976a1850
[INFO] fixing ActivityWatch/aw-watcher-window-wayland against try#622891a4e29178280638a6b63a8908bde2c0c854+cargoflags=-Zfix-edition=end=2015,2024 for pr-157817-2
[INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FActivityWatch%2Faw-watcher-window-wayland" "/workspace/builds/worker-6-tc2/source", kill_on_drop: false }`
[INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc2/source'...
[INFO] [stderr] done.
[INFO] started tweaking git repo https://github.com/ActivityWatch/aw-watcher-window-wayland
[INFO] finished tweaking git repo https://github.com/ActivityWatch/aw-watcher-window-wayland
[INFO] tweaked toml for git repo https://github.com/ActivityWatch/aw-watcher-window-wayland written to /workspace/builds/worker-6-tc2/source/Cargo.toml
[INFO] validating manifest of git repo https://github.com/ActivityWatch/aw-watcher-window-wayland on toolchain 622891a4e29178280638a6b63a8908bde2c0c854
[INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+622891a4e29178280638a6b63a8908bde2c0c854" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }`
[INFO] crate git repo https://github.com/ActivityWatch/aw-watcher-window-wayland already has a lockfile, it will not be regenerated
[INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+622891a4e29178280638a6b63a8908bde2c0c854" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }`
[INFO] [stderr]     Blocking waiting for file lock on package cache
[INFO] [stderr]     Blocking waiting for file lock on package cache
[INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc2/source:/opt/rustwide/workdir:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-m" "1610612736" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:3a6becf2bc8dde7f3fa57ede90e4f284e72d296796fc446bbb1e2c7cc0530151" "sleep" "infinity", kill_on_drop: false }`
[INFO] [stdout] 9da4f63b8338a9390da7a350daf35d52f37ada2d8743766cad447a0bdf97761c
[INFO] running `Command { std: "docker" "start" "9da4f63b8338a9390da7a350daf35d52f37ada2d8743766cad447a0bdf97761c", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-w" "/opt/rustwide/workdir" "--user" "0:0" "9da4f63b8338a9390da7a350daf35d52f37ada2d8743766cad447a0bdf97761c" "/opt/rustwide/cargo-home/bin/cargo" "+622891a4e29178280638a6b63a8908bde2c0c854" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "inspect" "9da4f63b8338a9390da7a350daf35d52f37ada2d8743766cad447a0bdf97761c", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=" "-e" "RUSTDOCFLAGS=" "-w" "/opt/rustwide/workdir" "--user" "0:0" "9da4f63b8338a9390da7a350daf35d52f37ada2d8743766cad447a0bdf97761c" "/opt/rustwide/cargo-home/bin/cargo" "+622891a4e29178280638a6b63a8908bde2c0c854" "fix" "--allow-no-vcs" "--allow-dirty" "--frozen" "--all" "--all-targets" "--message-format=json" "-Zfix-edition=end=2015,2024", kill_on_drop: false }`
[INFO] [stderr] crater-edition-check: migrating to next edition
[INFO] [stderr]    Migrating Cargo.toml from 2018 edition to 2021
[INFO] [stderr] note: Switching to Edition 2021 will enable the use of the version 2 feature resolver in Cargo.
[INFO] [stderr] This may cause some dependencies to be built with fewer features enabled than previously.
[INFO] [stderr] More information about the resolver changes may be found at https://doc.rust-lang.org/nightly/edition-guide/rust-2021/default-cargo-resolver.html
[INFO] [stderr] When building the following dependencies, the given features will no longer be used:
[INFO] [stderr] 
[INFO] [stderr]   rustix v0.38.34 removed features: default, fs, use-libc-auxv
[INFO] [stderr]   syn v2.0.60 (as host dependency) removed features: visit
[INFO] [stderr]   tokio v1.37.0 removed features: windows-sys
[INFO] [stderr] 
[INFO] [stderr]    Compiling libc v0.2.154
[INFO] [stderr]    Compiling proc-macro2 v1.0.81
[INFO] [stderr]    Compiling unicode-ident v1.0.12
[INFO] [stderr]    Compiling autocfg v1.2.0
[INFO] [stderr]    Compiling vcpkg v0.2.15
[INFO] [stderr]     Checking once_cell v1.19.0
[INFO] [stderr]     Checking pin-project-lite v0.2.14
[INFO] [stderr]    Compiling cc v1.0.96
[INFO] [stderr]    Compiling pkg-config v0.3.30
[INFO] [stderr]     Checking itoa v1.0.11
[INFO] [stderr]     Checking bytes v1.6.0
[INFO] [stderr]    Compiling serde v1.0.200
[INFO] [stderr]     Checking bitflags v2.5.0
[INFO] [stderr]     Checking futures-core v0.3.30
[INFO] [stderr]     Checking cfg-if v0.1.10
[INFO] [stderr]     Checking cfg-if v1.0.0
[INFO] [stderr]     Checking foreign-types-shared v0.1.1
[INFO] [stderr]     Checking log v0.4.21
[INFO] [stderr]     Checking fnv v1.0.7
[INFO] [stderr]    Compiling openssl v0.10.64
[INFO] [stderr]     Checking ryu v1.0.17
[INFO] [stderr]    Compiling native-tls v0.2.11
[INFO] [stderr]     Checking tracing-core v0.1.32
[INFO] [stderr]     Checking futures-sink v0.3.30
[INFO] [stderr]    Compiling httparse v1.8.0
[INFO] [stderr]     Checking pin-utils v0.1.0
[INFO] [stderr]     Checking hashbrown v0.14.5
[INFO] [stderr]     Checking tinyvec_macros v0.1.1
[INFO] [stderr]     Checking equivalent v1.0.1
[INFO] [stderr]     Checking foreign-types v0.3.2
[INFO] [stderr]     Checking futures-task v0.3.30
[INFO] [stderr]    Compiling xml-rs v0.8.20
[INFO] [stderr]     Checking memchr v2.7.2
[INFO] [stderr]    Compiling slab v0.4.9
[INFO] [stderr]    Compiling num-traits v0.2.18
[INFO] [stderr]     Checking futures-io v0.3.30
[INFO] [stderr]    Compiling serde_json v1.0.116
[INFO] [stderr]     Checking tinyvec v1.6.0
[INFO] [stderr]     Checking openssl-probe v0.1.5
[INFO] [stderr]     Checking http v0.2.12
[INFO] [stderr]    Compiling maybe-uninit v2.0.0
[INFO] [stderr]     Checking tracing v0.1.40
[INFO] [stderr]     Checking try-lock v0.2.5
[INFO] [stderr]     Checking void v1.0.2
[INFO] [stderr]     Checking bitflags v1.3.2
[INFO] [stderr]     Checking percent-encoding v2.3.1
[INFO] [stderr]     Checking want v0.3.1
[INFO] [stderr]     Checking futures-channel v0.3.30
[INFO] [stderr]     Checking indexmap v2.2.6
[INFO] [stderr]     Checking form_urlencoded v1.2.1
[INFO] [stderr]     Checking httpdate v1.0.3
[INFO] [stderr]    Compiling schemars v0.8.17
[INFO] [stderr]     Checking iana-time-zone v0.1.60
[INFO] [stderr]    Compiling quote v1.0.36
[INFO] [stderr]     Checking tower-service v0.3.2
[INFO] [stderr]     Checking futures-util v0.3.30
[INFO] [stderr]    Compiling nix v0.15.0
[INFO] [stderr]     Checking unicode-bidi v0.3.15
[INFO] [stderr]    Compiling syn v2.0.60
[INFO] [stderr]    Compiling wayland-scanner v0.24.1
[INFO] [stderr]    Compiling rustix v0.38.34
[INFO] [stderr]    Compiling gcc v0.3.55
[INFO] [stderr]    Compiling nix v0.11.1
[INFO] [stderr]     Checking dyn-clone v1.0.17
[INFO] [stderr]     Checking unicode-normalization v0.1.23
[INFO] [stderr]     Checking base64 v0.21.7
[INFO] [stderr]     Checking rustc-serialize v0.3.25
[INFO] [stderr]     Checking smallvec v0.6.14
[INFO] [stderr]     Checking http-body v0.4.6
[INFO] [stderr]     Checking encoding_rs v0.8.34
[INFO] [stderr]     Checking linux-raw-sys v0.4.13
[INFO] [stderr]     Checking ipnet v2.9.0
[INFO] [stderr]     Checking mime v0.3.17
[INFO] [stderr]     Checking wayland-sys v0.24.1
[INFO] [stderr]     Checking spin v0.5.2
[INFO] [stderr]     Checking sync_wrapper v0.1.2
[INFO] [stderr]     Checking downcast-rs v1.2.1
[INFO] [stderr]     Checking unicode-width v0.1.12
[INFO] [stderr]     Checking idna v0.5.0
[INFO] [stderr]     Checking appdirs v0.2.0
[INFO] [stderr]     Checking lazy_static v1.4.0
[INFO] [stderr]    Compiling openssl-sys v0.9.102
[INFO] [stderr]     Checking rustls-pemfile v1.0.4
[INFO] [stderr]     Checking getopts v0.2.21
[INFO] [stderr]    Compiling file-lock v1.1.20
[INFO] [stderr]     Checking mio v0.8.11
[INFO] [stderr]     Checking socket2 v0.5.7
[INFO] [stderr]     Checking rand v0.4.6
[INFO] [stderr]     Checking gethostname v0.4.3
[INFO] [stderr]     Checking iovec v0.1.4
[INFO] [stderr]     Checking url v2.5.0
[INFO] [stderr]     Checking net2 v0.2.39
[INFO] [stderr]     Checking gethostname v0.2.3
[INFO] [stderr]    Compiling wayland-client v0.24.1
[INFO] [stderr]    Compiling aw-watcher-window-wayland v0.1.0 (/opt/rustwide/workdir)
[INFO] [stderr]    Migrating src/build.rs from 2018 edition to 2021
[INFO] [stderr]     Checking mio v0.6.23
[INFO] [stderr]     Checking tokio v1.37.0
[INFO] [stderr]     Checking rand v0.3.23
[INFO] [stderr]     Checking uuid v0.1.18
[INFO] [stderr]     Checking mktemp v0.3.1
[INFO] [stderr]     Checking timerfd v1.6.0
[INFO] [stderr]     Checking wayland-commons v0.24.1
[INFO] [stderr]    Compiling serde_derive_internals v0.29.0
[INFO] [stderr]     Checking tokio-util v0.7.10
[INFO] [stderr]    Compiling serde_derive v1.0.200
[INFO] [stderr]    Compiling openssl-macros v0.1.1
[INFO] [stderr]    Compiling schemars_derive v0.8.17
[INFO] [stderr]     Checking h2 v0.3.26
[INFO] [stderr]     Checking hyper v0.14.28
[INFO] [stderr]     Checking tokio-native-tls v0.3.1
[INFO] [stderr]     Checking hyper-tls v0.5.0
[INFO] [stderr]     Checking chrono v0.4.38
[INFO] [stderr]     Checking serde_urlencoded v0.7.1
[INFO] [stderr]     Checking reqwest v0.11.27
[INFO] [stderr]     Checking aw-models v0.1.0 (https://github.com/ActivityWatch/aw-server-rust.git#c056e506)
[INFO] [stderr]     Checking aw-client-rust v0.1.0 (https://github.com/ActivityWatch/aw-server-rust.git#c056e506)
[INFO] [stderr]    Migrating src/main.rs from 2018 edition to 2021
[INFO] [stderr]     Finished `dev` profile [unoptimized + debuginfo] target(s) in 34.58s
[INFO] [stderr] crater-edition-check: aw-watcher-window-wayland v0.1.0 (/opt/rustwide/workdir) updating edition from 2018 to 2021
[INFO] [stderr]     Checking tokio v1.37.0
[INFO] [stderr]    Compiling syn v2.0.60
[INFO] [stderr]    Compiling rustix v0.38.34
[INFO] [stderr]    Compiling aw-watcher-window-wayland v0.1.0 (/opt/rustwide/workdir)
[INFO] [stderr]     Checking timerfd v1.6.0
[INFO] [stderr]     Checking tokio-util v0.7.10
[INFO] [stderr]    Compiling serde_derive_internals v0.29.0
[INFO] [stderr]     Checking h2 v0.3.26
[INFO] [stderr]    Compiling serde_derive v1.0.200
[INFO] [stderr]    Compiling openssl-macros v0.1.1
[INFO] [stderr]    Compiling schemars_derive v0.8.17
[INFO] [stderr]     Checking openssl v0.10.64
[INFO] [stderr]     Checking hyper v0.14.28
[INFO] [stderr]     Checking serde v1.0.200
[INFO] [stderr]     Checking native-tls v0.2.11
[INFO] [stderr]     Checking tokio-native-tls v0.3.1
[INFO] [stderr]     Checking hyper-tls v0.5.0
[INFO] [stderr]     Checking serde_json v1.0.116
[INFO] [stderr]     Checking chrono v0.4.38
[INFO] [stderr]     Checking serde_urlencoded v0.7.1
[INFO] [stderr]     Checking reqwest v0.11.27
[INFO] [stderr]     Checking schemars v0.8.17
[INFO] [stderr]     Checking aw-models v0.1.0 (https://github.com/ActivityWatch/aw-server-rust.git#c056e506)
[INFO] [stderr]     Checking aw-client-rust v0.1.0 (https://github.com/ActivityWatch/aw-server-rust.git#c056e506)
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:6801
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sen...
[INFO] [stdout]   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout]   = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:7890
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_t...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8034
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...e { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc ...
[INFO] [stdout]   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8446
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..., types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0"...
[INFO] [stdout]   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:6801
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sen...
[INFO] [stdout]   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout]   = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8661
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:7890
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_t...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8983
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...: 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8034
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...e { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc ...
[INFO] [stdout]   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:9080
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nt : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr...
[INFO] [stdout]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8446
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..., types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0"...
[INFO] [stdout]   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8661
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:28022
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...t wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:8983
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...: 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:34779
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_topleve...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:9080
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nt : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr...
[INFO] [stdout]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { &raw const zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:28022
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...t wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:34963
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...terface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface...
[INFO] [stdout]   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { &raw const super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35290
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:34779
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_topleve...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35664
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:34963
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...terface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface...
[INFO] [stdout]   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { &raw const super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35290
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35842
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36018
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35664
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36196
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * co...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:35842
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36368
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..., types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" a...
[INFO] [stdout]   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36018
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36581
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36196
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * co...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36762
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ypes : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\...
[INFO] [stdout]   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36368
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..., types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" a...
[INFO] [stdout]   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36982
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 a...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36581
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37162
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ypes : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_f...
[INFO] [stdout]   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36762
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ypes : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\...
[INFO] [stdout]   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37393
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_ou...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:36982
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 a...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37540
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_tople...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37162
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ypes : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_f...
[INFO] [stdout]   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37725
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37393
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_ou...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38089
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * cons...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37540
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_tople...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38259
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:37725
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nterface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation ...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38435
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_le...
[INFO] [stdout]   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38089
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * cons...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38658
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" ...
[INFO] [stdout]   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38259
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38874
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38435
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_le...
[INFO] [stdout]   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39041
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * cons...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38658
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" ...
[INFO] [stdout]   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39210
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:38874
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39531
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_f...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39041
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * cons...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39627
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nt : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5227
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (&...
[INFO] [stdout]   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5808
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...[unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super...
[INFO] [stdout]   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { &raw const super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5921
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39210
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:6316
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ar , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of ...
[INFO] [stdout]   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { &raw const org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:6647
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me...
[INFO] [stdout]   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:12081
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...onst wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeou...
[INFO] [stdout]   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39531
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_f...
[INFO] [stdout]   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13402
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * co...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13587
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/wlr-foreign-toplevel-management.rs:1:39627
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nt : 7 , events : unsafe { & zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "list and control opened apps\n\nThe purpose of this protocol is to enable the creation of taskbars\nand docks by providing them with a list of opened applications and\nletting them request certain actions on them, like maximizing, etc.\n\nAfter a client binds the zwlr_foreign_toplevel_manager_v1, each opened\ntoplevel window will be sent via the toplevel event"] pub mod zwlr_foreign_toplevel_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] Stop , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "stop" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Stop => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "a toplevel has been created\n\nThis event is emitted whenever a new toplevel window is created. It\nis emitted for all toplevels, regardless of the app that has created\nthem.\n\nAll initial details of the toplevel(title, app_id, states, etc.) will\nbe sent immediately after this event via the corresponding events in\nzwlr_foreign_toplevel_handle_v1."] Toplevel { toplevel : Main < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > , } , # [doc = "the compositor has finished with the toplevel manager\n\nThis event indicates that the compositor is done sending events to the\nzwlr_foreign_toplevel_manager_v1. The server will destroy the object\nimmediately after sending this request, so it will become invalid and\nthe client should free any resources associated with it."] Finished , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "toplevel" , since : 1 , signature : & [super :: ArgumentType :: NewId ,] , destructor : false , } , super :: MessageDesc { name : "finished" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 0 , Event :: Finished => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Toplevel { .. } => 1 , Event :: Finished => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Toplevel { toplevel : { if let Some (Argument :: NewId (val)) = args . next () { map . get_new (val) . ok_or (()) ? } else { return Err (()) ; } } , }) } , 1 => Ok (Event :: Finished) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Toplevel { toplevel : Main :: < super :: zwlr_foreign_toplevel_handle_v1 :: ZwlrForeignToplevelHandleV1 > :: from_c_ptr (_args [0] . o as * mut _) , }) } , 1 => { Ok (Event :: Finished) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelManagerV1 (Proxy < ZwlrForeignToplevelManagerV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelManagerV1 >> for ZwlrForeignToplevelManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelManagerV1 (value) } } impl From < ZwlrForeignToplevelManagerV1 > for Proxy < ZwlrForeignToplevelManagerV1 > { # [inline] fn from (value : ZwlrForeignToplevelManagerV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_manager_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_manager_v1_interface } } } impl ZwlrForeignToplevelManagerV1 { # [doc = "stop sending events\n\nIndicates the client no longer wishes to receive events for new toplevels.\nHowever the compositor may emit further toplevel_created events, until\nthe finished event is emitted.\n\nThe client must not send any more requests after this one."] pub fn stop (& self ,) -> () { let msg = Request :: Stop ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_STOP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TOPLEVEL_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FINISHED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"stop\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_manager_v1_events_toplevel_types : [* const wl_interface ; 1] = [unsafe { & super :: zwlr_foreign_toplevel_handle_v1 :: zwlr_foreign_toplevel_handle_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_events : [wl_message ; 2] = [wl_message { name : b"toplevel\0" as * const u8 as * const c_char , signature : b"n\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_manager_v1_events_toplevel_types as * const _ } , } , wl_message { name : b"finished\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_manager_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_manager_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 1 , requests : unsafe { & zwlr_foreign_toplevel_manager_v1_requests as * const _ } , event_count : 2 , events : unsafe { & zwlr_foreign_toplevel_manager_v1_events as * const _ } , } ; } # [doc = "an opened toplevel\n\nA zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel\nwindow. Each app may have multiple opened toplevels.\n\nEach toplevel has a list of outputs it is visible on, conveyed to the\nclient with the output_enter and output_leave events."] pub mod zwlr_foreign_toplevel_handle_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [doc = "types of states on the toplevel\n\nThe different states that a toplevel can have. These have the same meaning\nas the states with the same names defined in xdg-toplevel"] # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum State { # [doc = "the toplevel is maximized"] Maximized = 0 , # [doc = "the toplevel is minimized"] Minimized = 1 , # [doc = "the toplevel is active"] Activated = 2 , # [doc = "the toplevel is fullscreen"] Fullscreen = 3 , # [doc (hidden)] __nonexhaustive , } impl State { pub fn from_raw (n : u32) -> Option < State > { match n { 0 => Some (State :: Maximized) , 1 => Some (State :: Minimized) , 2 => Some (State :: Activated) , 3 => Some (State :: Fullscreen) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] pub enum Error { # [doc = "the provided rectangle is invalid"] InvalidRectangle = 0 , # [doc (hidden)] __nonexhaustive , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: InvalidRectangle) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } pub enum Request { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] SetMaximized , # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] UnsetMaximized , # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] SetMinimized , # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] UnsetMinimized , # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] Activate { seat : super :: wl_seat :: WlSeat , } , # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] Close , # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] SetRectangle { surface : super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32 , } , # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface"] SetFullscreen { output : Option < super :: wl_output :: WlOutput > , } , # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface"] UnsetFullscreen , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "set_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_maximized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "unset_minimized" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "activate" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "close" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "set_rectangle" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int , super :: ArgumentType :: Int ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "set_fullscreen" , since : 2 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unset_fullscreen" , since : 2 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 0 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 2 , Request :: UnsetMinimized => 3 , Request :: Activate { .. } => 4 , Request :: Close => 5 , Request :: SetRectangle { .. } => 6 , Request :: Destroy => 7 , Request :: SetFullscreen { .. } => 8 , Request :: UnsetFullscreen => 9 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => 1 , Request :: UnsetMaximized => 1 , Request :: SetMinimized => 1 , Request :: UnsetMinimized => 1 , Request :: Activate { .. } => 1 , Request :: Close => 1 , Request :: SetRectangle { .. } => 1 , Request :: Destroy => 1 , Request :: SetFullscreen { .. } => 2 , Request :: UnsetFullscreen => 2 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: UnsetMaximized => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , Request :: SetMinimized => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [] , } , Request :: UnsetMinimized => Message { sender_id : sender_id , opcode : 3 , args : smallvec ! [] , } , Request :: Activate { seat } => Message { sender_id : sender_id , opcode : 4 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) ,] , } , Request :: Close => Message { sender_id : sender_id , opcode : 5 , args : smallvec ! [] , } , Request :: SetRectangle { surface , x , y , width , height } => Message { sender_id : sender_id , opcode : 6 , args : smallvec ! [Argument :: Object (surface . as_ref () . id ()) , Argument :: Int (x) , Argument :: Int (y) , Argument :: Int (width) , Argument :: Int (height) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 7 , args : smallvec ! [] , } , Request :: SetFullscreen { output } => Message { sender_id : sender_id , opcode : 8 , args : smallvec ! [Argument :: Object (output . map (| o | o . as_ref () . id ()) . unwrap_or (0)) ,] , } , Request :: UnsetFullscreen => Message { sender_id : sender_id , opcode : 9 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: SetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: UnsetMaximized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , Request :: SetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (2 , & mut _args_array) } , Request :: UnsetMinimized => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & mut _args_array) } , Request :: Activate { seat } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; f (4 , & mut _args_array) } , Request :: Close => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (5 , & mut _args_array) } , Request :: SetRectangle { surface , x , y , width , height } => { let mut _args_array : [wl_argument ; 5] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = surface . as_ref () . c_ptr () as * mut _ ; _args_array [1] . i = x ; _args_array [2] . i = y ; _args_array [3] . i = width ; _args_array [4] . i = height ; f (6 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (7 , & mut _args_array) } , Request :: SetFullscreen { output } => { let mut _args_array : [wl_argument ; 1] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = output . map (| o | o . as_ref () . c_ptr () as * mut _) . unwrap_or (:: std :: ptr :: null_mut ()) ; f (8 , & mut _args_array) } , Request :: UnsetFullscreen => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (9 , & mut _args_array) } , } } } pub enum Event { # [doc = "title change\n\nThis event is emitted whenever the title of the toplevel changes."] Title { title : String , } , # [doc = "app-id change\n\nThis event is emitted whenever the app-id of the toplevel changes."] AppId { app_id : String , } , # [doc = "toplevel entered an output\n\nThis event is emitted whenever the toplevel becomes visible on\nthe given output. A toplevel may be visible on multiple outputs."] OutputEnter { output : super :: wl_output :: WlOutput , } , # [doc = "toplevel left an output\n\nThis event is emitted whenever the toplevel stops being visible on\nthe given output. It is guaranteed that an entered-output event\nwith the same output has been emitted before this event."] OutputLeave { output : super :: wl_output :: WlOutput , } , # [doc = "the toplevel state changed\n\nThis event is emitted immediately after the zlw_foreign_toplevel_handle_v1\nis created and each time the toplevel state changes, either because of a\ncompositor action or because of a request in this protocol."] State { state : Vec < u8 > , } , # [doc = "all information about the toplevel has been sent\n\nThis event is sent after all changes in the toplevel state have been\nsent.\n\nThis allows changes to the zwlr_foreign_toplevel_handle_v1 properties\nto be seen as atomic, even if they happen via multiple events."] Done , # [doc = "this toplevel has been destroyed\n\nThis event means the toplevel has been destroyed. It is guaranteed there\nwon't be any more events for this zwlr_foreign_toplevel_handle_v1. The\ntoplevel itself becomes inert so any requests will be ignored except the\ndestroy request."] Closed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "title" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "app_id" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "output_enter" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "output_leave" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "state" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "done" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "closed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 0 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 2 , Event :: OutputLeave { .. } => 3 , Event :: State { .. } => 4 , Event :: Done => 5 , Event :: Closed => 6 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Title { .. } => 1 , Event :: AppId { .. } => 1 , Event :: OutputEnter { .. } => 1 , Event :: OutputLeave { .. } => 1 , Event :: State { .. } => 1 , Event :: Done => 1 , Event :: Closed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: Title { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: AppId { app_id : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputEnter { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: OutputLeave { output : { if let Some (Argument :: Object (val)) = args . next () { map . get (val) . ok_or (()) ? . into () } else { return Err (()) ; } } , }) } , 4 => { let mut args = msg . args . into_iter () ; Ok (Event :: State { state : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 5 => Ok (Event :: Done) , 6 => Ok (Event :: Closed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Title { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: AppId { app_id : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputEnter { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: OutputLeave { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 4 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: State { state : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 5 => { Ok (Event :: Done) } , 6 => { Ok (Event :: Closed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZwlrForeignToplevelHandleV1 (Proxy < ZwlrForeignToplevelHandleV1 >) ; impl AsRef < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwlrForeignToplevelHandleV1 >> for ZwlrForeignToplevelHandleV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwlrForeignToplevelHandleV1 (value) } } impl From < ZwlrForeignToplevelHandleV1 > for Proxy < ZwlrForeignToplevelHandleV1 > { # [inline] fn from (value : ZwlrForeignToplevelHandleV1) -> Self { value . 0 } } impl Interface for ZwlrForeignToplevelHandleV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwlr_foreign_toplevel_handle_v1" ; const VERSION : u32 = 2 ; fn c_interface () -> * const wl_interface { unsafe { & zwlr_foreign_toplevel_handle_v1_interface } } } impl ZwlrForeignToplevelHandleV1 { # [doc = "requests that the toplevel be maximized\n\nRequests that the toplevel be maximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn set_maximized (& self ,) -> () { let msg = Request :: SetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unmaximized\n\nRequests that the toplevel be unmaximized. If the maximized state actually\nchanges, this will be indicated by the state event."] pub fn unset_maximized (& self ,) -> () { let msg = Request :: UnsetMaximized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be minimized\n\nRequests that the toplevel be minimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn set_minimized (& self ,) -> () { let msg = Request :: SetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "requests that the toplevel be unminimized\n\nRequests that the toplevel be unminimized. If the minimized state actually\nchanges, this will be indicated by the state event."] pub fn unset_minimized (& self ,) -> () { let msg = Request :: UnsetMinimized ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "activate the toplevel\n\nRequest that this toplevel be activated on the given seat.\nThere is no guarantee the toplevel will be actually activated."] pub fn activate (& self , seat : & super :: wl_seat :: WlSeat) -> () { let msg = Request :: Activate { seat : seat . clone () } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be closed\n\nSend a request to the toplevel to close itself. The compositor would\ntypically use a shell-specific method to carry out this request, for\nexample by sending the xdg_toplevel.close event. However, this gives\nno guarantees the toplevel will actually be destroyed. If and when\nthis happens, the zwlr_foreign_toplevel_handle_v1.closed event will\nbe emitted."] pub fn close (& self ,) -> () { let msg = Request :: Close ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "the rectangle which represents the toplevel\n\nThe rectangle of the surface specified in this request corresponds to\nthe place where the app using this protocol represents the given toplevel.\nIt can be used by the compositor as a hint for some operations, e.g\nminimizing. The client is however not required to set this, in which\ncase the compositor is free to decide some default value.\n\nIf the client specifies more than one rectangle, only the last one is\nconsidered.\n\nThe dimensions are given in surface-local coordinates.\nSetting width=height=0 removes the already-set rectangle."] pub fn set_rectangle (& self , surface : & super :: wl_surface :: WlSurface , x : i32 , y : i32 , width : i32 , height : i32) -> () { let msg = Request :: SetRectangle { surface : surface . clone () , x : x , y : y , width : width , height : height } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the zwlr_foreign_toplevel_handle_v1 object\n\nDestroys the zwlr_foreign_toplevel_handle_v1 object.\n\nThis request should be called either when the client does not want to\nuse the toplevel anymore or after the closed event to finalize the\ndestruction of the object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be fullscreened\n\nRequests that the toplevel be fullscreened on the given output. If the\nfullscreen state and/or the outputs the toplevel is visible on actually\nchange, this will be indicated by the state and output_enter/leave\nevents.\n\nThe output parameter is only a hint to the compositor. Also, if output\nis NULL, the compositor should decide which output the toplevel will be\nfullscreened on, if at all.\n\nOnly available since version 2 of the interface."] pub fn set_fullscreen (& self , output : Option < & super :: wl_output :: WlOutput >) -> () { let msg = Request :: SetFullscreen { output : output . map (| o | o . clone ()) } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "request that the toplevel be unfullscreened\n\nRequests that the toplevel be unfullscreened. If the fullscreen state\nactually changes, this will be indicated by the state event.\n\nOnly available since version 2 of the interface."] pub fn unset_fullscreen (& self ,) -> () { let msg = Request :: UnsetFullscreen ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MAXIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_MINIMIZED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_ACTIVATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_CLOSE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_RECTANGLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_UNSET_FULLSCREEN_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_TITLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_APP_ID_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_ENTER_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_OUTPUT_LEAVE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_STATE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_DONE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_CLOSED_SINCE : u32 = 1u32 ; static mut zwlr_foreign_toplevel_handle_v1_requests_activate_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types : [* const wl_interface ; 5] = [unsafe { & super :: wl_surface :: wl_surface_interface as * const wl_interface } , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface , NULLPTR as * const wl_interface ,] ; static mut zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_requests : [wl_message ; 10] = [wl_message { name : b"set_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_maximized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"unset_minimized\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"activate\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_activate_types as * const _ } , } , wl_message { name : b"close\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_rectangle\0" as * const u8 as * const c_char , signature : b"oiiii\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_rectangle_types as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"set_fullscreen\0" as * const u8 as * const c_char , signature : b"2?o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_requests_set_fullscreen_types as * const _ } , } , wl_message { name : b"unset_fullscreen\0" as * const u8 as * const c_char , signature : b"2\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_enter_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zwlr_foreign_toplevel_handle_v1_events_output_leave_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_events : [wl_message ; 7] = [wl_message { name : b"title\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"app_id\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"output_enter\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_enter_types as * const _ } , } , wl_message { name : b"output_leave\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zwlr_foreign_toplevel_handle_v1_events_output_leave_types as * const _ } , } , wl_message { name : b"state\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"done\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"closed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwlr_foreign_toplevel_handle_v1_interface : wl_interface = wl_interface { name : b"zwlr_foreign_toplevel_handle_v1\0" as * const u8 as * const c_char , version : 2 , request_count : 10 , requests : unsafe { & zwlr_foreign_toplevel_handle_v1_requests as * const _ } , event_count : 7 , events : unsafe { &raw const zwlr_foreign_toplevel_handle_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13905
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * con...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5227
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (&...
[INFO] [stdout]   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:14075
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for ...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5808
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...[unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super...
[INFO] [stdout]   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { &raw const super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:5921
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,]...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:14383
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nt : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_k...
[INFO] [stdout]   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { &raw const org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:6316
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...ar , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of ...
[INFO] [stdout]   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { &raw const org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:14473
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { &raw const org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:6647
[INFO] [stdout]   |
[INFO] [stdout] 1 | ..._count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_me...
[INFO] [stdout]   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:6081
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDe...
[INFO] [stdout]   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:12081
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...onst wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeou...
[INFO] [stdout]   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:7544
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * cons...
[INFO] [stdout]   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { &raw const super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13402
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * co...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:7689
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...nst wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of...
[INFO] [stdout]   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13587
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:8041
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * con...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:8228
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation...
[INFO] [stdout]   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { &raw const ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/idle.rs:1:13905
[INFO] [stdout]   |
[INFO] [stdout] 1 | ... u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * con...
[INFO] [stdout]   |                                             ^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "User idle time manager\n\nThis interface allows to monitor user idle time on a given seat. The interface\nallows to register timers which trigger after no user activity was registered\non the seat for a given interval. It notifies when user activity resumes.\n\nThis is useful for applications wanting to perform actions when the user is not\ninteracting with the system, e.g. chat applications setting the user as away, power\nmanagement features to dim screen, etc.."] pub mod org_kde_kwin_idle { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = ""] GetIdleTimeout { seat : super :: wl_seat :: WlSeat , timeout : u32 , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "get_idle_timeout" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object , super :: ArgumentType :: Uint ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) , Argument :: Uint (timeout) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: GetIdleTimeout { seat , timeout } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [2] . u = timeout ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdle (Proxy < OrgKdeKwinIdle >) ; impl AsRef < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdle >> for OrgKdeKwinIdle { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdle (value) } } impl From < OrgKdeKwinIdle > for Proxy < OrgKdeKwinIdle > { # [inline] fn from (value : OrgKdeKwinIdle) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdle { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_interface } } } impl OrgKdeKwinIdle { # [doc = ""] pub fn get_idle_timeout (& self , seat : & super :: wl_seat :: WlSeat , timeout : u32) -> Main < super :: org_kde_kwin_idle_timeout :: OrgKdeKwinIdleTimeout > { let msg = Request :: GetIdleTimeout { seat : seat . clone () , timeout : timeout } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_TIMEOUT_SINCE : u32 = 1u32 ; static mut org_kde_kwin_idle_requests_get_idle_timeout_types : [* const wl_interface ; 3] = [unsafe { & super :: org_kde_kwin_idle_timeout :: org_kde_kwin_idle_timeout_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , NULLPTR as * const wl_interface ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_requests : [wl_message ; 1] = [wl_message { name : b"get_idle_timeout\0" as * const u8 as * const c_char , signature : b"nou\0" as * const u8 as * const c_char , types : unsafe { & org_kde_kwin_idle_requests_get_idle_timeout_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & org_kde_kwin_idle_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } pub mod org_kde_kwin_idle_timeout { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "release the timeout object\n\n\n\nThis is a destructor, once sent this object cannot be used any longer."] Release , # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] SimulateUserActivity , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "release" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "simulate_user_activity" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 0 , Request :: SimulateUserActivity => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => 1 , Request :: SimulateUserActivity => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: SimulateUserActivity => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Release => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: SimulateUserActivity => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc = "Triggered when there has not been any user activity in the requested idle time interval"] Idle , # [doc = "Triggered on the first user activity after an idle event"] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idle" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idle => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idle) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idle) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct OrgKdeKwinIdleTimeout (Proxy < OrgKdeKwinIdleTimeout >) ; impl AsRef < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < OrgKdeKwinIdleTimeout >> for OrgKdeKwinIdleTimeout { # [inline] fn from (value : Proxy < Self >) -> Self { OrgKdeKwinIdleTimeout (value) } } impl From < OrgKdeKwinIdleTimeout > for Proxy < OrgKdeKwinIdleTimeout > { # [inline] fn from (value : OrgKdeKwinIdleTimeout) -> Self { value . 0 } } impl Interface for OrgKdeKwinIdleTimeout { type Request = Request ; type Event = Event ; const NAME : & 'static str = "org_kde_kwin_idle_timeout" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & org_kde_kwin_idle_timeout_interface } } } impl OrgKdeKwinIdleTimeout { # [doc = "release the timeout object\n\n\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn release (& self ,) -> () { let msg = Request :: Release ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "Simulates user activity for this timeout, behaves just like real user activity on the seat"] pub fn simulate_user_activity (& self ,) -> () { let msg = Request :: SimulateUserActivity ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_RELEASE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_SIMULATE_USER_ACTIVITY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLE_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_requests : [wl_message ; 2] = [wl_message { name : b"release\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"simulate_user_activity\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_events : [wl_message ; 2] = [wl_message { name : b"idle\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut org_kde_kwin_idle_timeout_interface : wl_interface = wl_interface { name : b"org_kde_kwin_idle_timeout\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { & org_kde_kwin_idle_timeout_requests as * const _ } , event_count : 2 , events : unsafe { & org_kde_kwin_idle_timeout_events as * const _ } , } ; }
[INFO] [stdout]   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +++++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] warning: creating a shared reference to mutable static
[INFO] [stdout]  --> src/protocols/ext-idle-notify-v1.rs:1:8573
[INFO] [stdout]   |
[INFO] [stdout] 1 | ...count : 2 , requests : unsafe { & ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_...
[INFO] [stdout]   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
[INFO] [stdout]   |
[INFO] [stdout]   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
[INFO] [stdout]   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
[INFO] [stdout] help: use `&raw const` instead to create a raw pointer
[INFO] [stdout]   |
[INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 0] = [] ; # [doc = "idle notification manager\n\nThis interface allows clients to monitor user idle status.\n\nAfter binding to this global, clients can create ext_idle_notification_v1\nobjects to get notified when the user is idle for a given amount of time."] pub mod ext_idle_notifier_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] GetIdleNotification { timeout : u32 , seat : super :: wl_seat :: WlSeat , } , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_idle_notification" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Uint , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , Request :: GetIdleNotification { .. } => 1 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , Request :: GetIdleNotification { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetIdleNotification { timeout , seat } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Uint (timeout) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetIdleNotification { timeout , seat } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . u = timeout ; _args_array [2] . o = seat . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , } } } pub enum Event { # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotifierV1 (Proxy < ExtIdleNotifierV1 >) ; impl AsRef < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotifierV1 >> for ExtIdleNotifierV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotifierV1 (value) } } impl From < ExtIdleNotifierV1 > for Proxy < ExtIdleNotifierV1 > { # [inline] fn from (value : ExtIdleNotifierV1) -> Self { value . 0 } } impl Interface for ExtIdleNotifierV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notifier_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notifier_v1_interface } } } impl ExtIdleNotifierV1 { # [doc = "destroy the manager\n\nDestroy the manager object. All objects created via this interface\nremain valid.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create a notification object\n\nCreate a new idle notification object.\n\nThe notification object has a minimum timeout duration and is tied to a\nseat. The client will be notified if the seat is inactive for at least\nthe provided timeout. See ext_idle_notification_v1 for more details.\n\nA zero timeout is valid and means the client wants to be notified as\nsoon as possible when the seat is inactive."] pub fn get_idle_notification (& self , timeout : u32 , seat : & super :: wl_seat :: WlSeat) -> Main < super :: ext_idle_notification_v1 :: ExtIdleNotificationV1 > { let msg = Request :: GetIdleNotification { timeout : timeout , seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_IDLE_NOTIFICATION_SINCE : u32 = 1u32 ; static mut ext_idle_notifier_v1_requests_get_idle_notification_types : [* const wl_interface ; 3] = [unsafe { & super :: ext_idle_notification_v1 :: ext_idle_notification_v1_interface as * const wl_interface } , NULLPTR as * const wl_interface , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notifier_v1_requests : [wl_message ; 2] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_idle_notification\0" as * const u8 as * const c_char , signature : b"nuo\0" as * const u8 as * const c_char , types : unsafe { & ext_idle_notifier_v1_requests_get_idle_notification_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notifier_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notifier_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 2 , requests : unsafe { &raw const ext_idle_notifier_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "idle notification\n\nThis interface is used by the compositor to send idle notification events\nto clients.\n\nInitially the notification object is not idle. The notification object\nbecomes idle when no user activity has happened for at least the timeout\nduration, starting from the creation of the notification object. User\nactivity may include input events or a presence sensor, but is\ncompositor-specific. If an idle inhibitor is active (e.g. another client\nhas created a zwp_idle_inhibitor_v1 on a visible surface), the compositor\nmust not make the notification object idle.\n\nWhen the notification object becomes idle, an idled event is sent. When\nuser activity starts again, the notification object stops being idle,\na resumed event is sent and the timeout is restarted."] pub mod ext_idle_notification_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; pub enum Request { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: __nonexhaustive => unreachable ! () , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } pub enum Event { # [doc = "notification object is idle\n\nThis event is sent when the notification object becomes idle.\n\nIt's a compositor protocol error to send this event twice without a\nresumed event in-between."] Idled , # [doc = "notification object is no longer idle\n\nThis event is sent when the notification object stops being idle.\n\nIt's a compositor protocol error to send this event twice without an\nidled event in-between. It's a compositor protocol error to send this\nevent prior to any idled event."] Resumed , # [doc (hidden)] __nonexhaustive , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "idled" , since : 1 , signature : & [] , destructor : false , } , super :: MessageDesc { name : "resumed" , since : 1 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Event :: __nonexhaustive => unreachable ! () , _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 0 , Event :: Resumed => 1 , } } fn since (& self) -> u32 { match * self { Event :: __nonexhaustive => unreachable ! () , Event :: Idled => 1 , Event :: Resumed => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => Ok (Event :: Idled) , 1 => Ok (Event :: Resumed) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { Ok (Event :: Idled) } , 1 => { Ok (Event :: Resumed) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ExtIdleNotificationV1 (Proxy < ExtIdleNotificationV1 >) ; impl AsRef < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ExtIdleNotificationV1 >> for ExtIdleNotificationV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ExtIdleNotificationV1 (value) } } impl From < ExtIdleNotificationV1 > for Proxy < ExtIdleNotificationV1 > { # [inline] fn from (value : ExtIdleNotificationV1) -> Self { value . 0 } } impl Interface for ExtIdleNotificationV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "ext_idle_notification_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & ext_idle_notification_v1_interface } } } impl ExtIdleNotificationV1 { # [doc = "destroy the notification object\n\nDestroy the notification object.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_IDLED_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_RESUMED_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut ext_idle_notification_v1_events : [wl_message ; 2] = [wl_message { name : b"idled\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"resumed\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut ext_idle_notification_v1_interface : wl_interface = wl_interface { name : b"ext_idle_notification_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & ext_idle_notification_v1_requests as * const _ } , event_count : 2 , events : unsafe { & ext_idle_notification_v1_events as * const _ } , } ; }
[WARN] too much data in the log, truncating it
